package com.forekenow.Demo5;

public class Singleton2 {

    //常量
    public  static final String NAME ="tom";

    public static void main(String[] args) {
//        Singleton singleton = new Singleton();
        Singleton singleton = Singleton.getInstance();
        singleton.setName("tom");
        System.out.println(singleton.getName());
        Singleton sub =   Singleton.getInstance();
        System.out.println(singleton.getName());

    }
}
